<template>
  <div class="container">
    <el-dialog
      title="加工详情"
      :visible.sync="dialog.centerDialogVisible"
      @open="getData"
      @close="confirm"
      center
    >
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        empty-text="暂无数据"
      >
        <el-table-column
          prop="goods_name"
          label="原料名称"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="erp_goods_code"
          label="原料code"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="goods_bar_code"
          label="原料条形码"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="unit"
          label="单位"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="num"
          label="数量"
          align="center"
        ></el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  props: {
    dialog: Object,
  },
  data() {
    return {
      tableData: [],
    };
  },
  created() {},
  methods: {
    //关闭
    confirm() {
      this.dialog.centerDialogVisible = false;
    },
    // 获取数据
    getData() {
      this.tableData = this.dialog.tableData;
    },
  },
};
</script>
<style scoped>
.pagination {
  text-align: right;
  padding: 10px;
  background-size: cover;
}
</style>